﻿<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>导医前台管理-登录页</title>
		<link rel="shortcut icon" href="#(basepath)/static/style/images/favicon.ico" type="image/x-icon" />
		<meta name="description" content="User login page" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<link rel="stylesheet" href="#(basepath)/static/assets/css/bootstrap.css" />
		<link rel="stylesheet" href="#(basepath)/static/assets/css/font-awesome.css" />
		<!-- text fonts -->
		<link rel="stylesheet" href="#(basepath)/static/assets/css/ace-fonts.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="#(basepath)/static/assets/css/ace.css" />
		<link rel="stylesheet" href="#(basepath)/static/assets/css/ace-rtl.css" />
		 <script src="#(basepath)/jquery-3.2.1.js"></script>
		<script type="text/javascript" src="#(basepath)/jquery-3.2.1.min.js"></script>
		<script src="#(basepath)/static/layer/layer.js"></script>		
		<script src="#(basepath)/static/blade/js/blade-ajax.js" type="text/javascript" ></script>
        <script src="#(basepath)/static/assets/js/config.js" type="text/javascript"></script>
        <script src="#(basepath)/static/assets/js/function.js" type="text/javascript"></script>
        <script type="text/javascript">
			$(function(){
				if(self != top){
					var url = window.location.href;
					parent.window.location.href=url;
				}
			});
		</script>
	</head>
	<body class="login-layout light-login">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1" style="margin-top: 10%">
						<div class="login-container">
							<div class="center">
								<h1>
									<span class="blue">导医前台</span>
								</h1>
							</div>
							<br>
							<div class="space-6"></div>
							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="ace-icon fa fa-coffee blue"></i>
												请登录
											</h4>
											<div class="space-6"></div>
											
												<div class="input-group input-group-sx">
														<span class="input-group-addon">
															<i class="fa fa-user" style="width:15px;"></i>
														</span>
														<input type="password" name="triage.triage_pwd" class="form-control" placeholder="请输入密码" id="pswd">
												</div>
												<br>
												<br>
												<div class="clearfix">
														<button type="reset" class="width-30 pull-left btn btn-sm btn-info">
															<i class="ace-icon fa fa-refresh"></i>
															<span class="bigger-110">重置</span>
														</button>

														<button type="button" class="width-65 pull-right btn btn-sm btn-primary" onclick="login()">
															<span class="bigger-110">登录</span>

															<i class="ace-icon fa fa-arrow-right icon-on-right"></i>
														</button>
													</div>
											
										</div>
										<div class="toolbar clearfix" style="text-align: center;margin:0 auto;">
                                            <div style="float:none;text-align: center;font-size: 16px;color: white;">
                                                2017<a target="_blank" href="http://web-service.cn" style="color:white;text-decoration: none;">&copy; web-service</a>
                                            </div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
            
			window.jQuery || document.write("<script src='#(basepath)/static/assets/js/jquery.js'>"+"<"+"/script>");
            if ('ontouchstart' in document.documentElement) document.write("<script src='#(basepath)/static/assets/js/jquery.mobile.custom.js'>" + "<" + "/script>");
            function login() {
                var pswd = $("#pswd").val();
                
                if (pswd != "" && pswd != null) {
                    $.ajax({
                        type: "POST",    //请求方式
                        async: true,    //是否异步
                        url: "#(basepath)/login/login",
                        dataType: "json",
                        data: { "password": pswd },    //请求参数
                        success: function (data) {
                            //请求成功处理，和本地回调完全一样
                            if (data.return_code == "success") {
                                layer.msg(data.return_msg, { shift: 1, time: 2000 });
                                window.location.href = 'index.html';
                            }
                            else
                                layer.msg(data.return_msg, { shift: 1, time: 2000 });
                        }

                    });
                }
                else {
                    layer.msg("请输入密码", { shift: 1, time: 2000 });
                }

            }
            $(function () {
                document.onkeydown = function (e) {
                    var ev = document.all ? window.event : e;
                    if (ev.keyCode == 13) {
                        login();
     }
                }
            });   
		</script>
	</body>
</html>